package com.cx.tran2.controller;

import com.cx.aspec.TranAspec;
import com.cx.tran2.service.Tran2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Trans2Controller {
    @Autowired
    private Tran2Service tran2Service;



    @RequestMapping("/add/{p}/{key}")
    public String test1(@PathVariable String p,@PathVariable String key){
        TranAspec.TRANSKEY.set(key);
        tran2Service.addTest2(p);
        return "ok2";
    }

    @RequestMapping("/update/{id}/{p}")
    public String test2(@PathVariable String p,@PathVariable Long id){
        tran2Service.updateTest2(p,id);
        return "ok2";
    }
}
